package com.lz.controller;

import com.lz.domain.MyUserDetails;
import com.lz.domain.User;
import com.lz.service.UserService;
import com.lz.utils.Result;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <pre>
 * @描述：
 * @作者：lizhao
 * @创建时间： 2024/8/19 下午3:11
 * </pre>
 **/
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @PostMapping("/login")
    public Result<Object> login(@RequestBody User user) {
        String token = userService.login(user);
        return new Result<>(token);
    }

    @PostMapping("/test")
    public Result<Object> test() {
        return new Result<>("token");
    }

}
